package com.java.jvm.demo.chapter01;

import sun.misc.Launcher;

import java.net.URL;

/**
 * @author wangning
 * @create 2021-10-14 20:08
 */
public class ClassLoaderTest1 {
	public static void main(String[] args) {
		System.out.println("***********启动类加载器***********");
		//获取BootstrapClassLoader能够加载的API路径
		URL[] urls = Launcher.getBootstrapClassPath().getURLs();
		for (URL element : urls) {
			System.out.println(element.toExternalForm());
		}
		//从上面的路径中随意选择一个类，来看看它的类加载器是什么

		System.out.println("*****************扩展类加载器****************");
		String extDirs = System.getProperty("java.ext.dirs");
		for (String path : extDirs.split(";")) {
			System.out.println(path);
		}


	}
}
